package com.ztomorrow.ying_cun_plus.dto.resp;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

@Data
@Builder
public class BookCommentRespDto {

    private Long commentTotal;


    private List<CommentInfo> comments;

    @Data
    @Builder
    public static class CommentInfo {

        @JsonFormat(shape = JsonFormat.Shape.STRING)
        private Long id;

        private String commentContent;


        @JsonSerialize(using = UsernameSerializer.class)
        private String commentUser;

        @JsonFormat(shape = JsonFormat.Shape.STRING)
        private Long commentUserId;

        private String commentUserPhoto;

        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        private LocalDateTime commentTime;

    }
}
